package com.youpai.platform.pay.web.api;

import com.youpai.platform.common.entity.resp.BaseResponse;
import com.youpai.platform.common.util.UserContext;
import com.youpai.platform.pay.service.service.GooglePayCallBackService;
import com.youpai.platform.pay.web.entity.dto.GooglePayDTO;
import com.youpai.platform.pay.web.entity.resp.CheckGooglePayResp;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2022/12/25
 * @author: Welles
 * @version: 1.0
 * @description: 谷歌支付回调
 */
@RequestMapping("/pay/check")
@RestController
public class PayCheckController {

    @javax.annotation.Resource
    private GooglePayCallBackService googlePayCallBackService;

    @PostMapping("/google")
    public BaseResponse<CheckGooglePayResp> checkGooglePay(@RequestBody GooglePayDTO googlePayDTO) {
        return BaseResponse.success(googlePayCallBackService.checkGooglePay(googlePayDTO));
    }
}